package com.kj.xuyuan.adapter;

import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.kj.xuyuan.R;
import com.kj.xuyuan.model.ChargeBean;

import java.util.List;

import androidx.annotation.Nullable;

public class ChargeAdapter extends BaseQuickAdapter<ChargeBean, BaseViewHolder> {

    public ChargeAdapter() {
        super(R.layout.item_recharge);
    }

    @Override
    protected void convert(BaseViewHolder helper, ChargeBean item) {
        helper.setText(R.id.tv_diamonds,item.getNum()+"钻");
        helper.setText(R.id.tv_money,item.getMoney()+"元");

        LinearLayout parent = helper.getView(R.id.ll_parent);
        if(item.isSelected()){
            parent.setBackgroundResource(R.drawable.shape_pink_corners_5);
        }else{
            parent.setBackgroundResource(R.drawable.shape_gray_bg_5);
        }
    }
}
